import java.util.Scanner;

public class Array {
    public static void main(String[] args) {
        String[] strings = new String[100];
        int i = 0;
        System.out.println("输入:");
        for (i = 0; i < 100; i++) {
            Scanner scanner = new Scanner(System.in);
            String str = scanner.next();
            if (str.equals("end")) {
                break;
            } else {
                strings[i] = str;
            }
        }

//        String[] newStrings = Arrays.copyOf(strings, i);
//        System.out.println("本次输入结果:" + Arrays.toString(newStrings));
        System.out.println("输出:");
        for (String string : strings) {
            if (string != null) {
                System.out.println(string);
            }
        }
    }
}
